#!/sbin/openrc-run

description="Bitcoin daemon"
name=bitcoind
command=/usr/bin/$name
config=/etc/bitcoin.conf
user=bitcoin
group=bitcoin
datadir=/var/lib/bitcoin
pidfile="/run/bitcoin/$RC_SVCNAME.pid"
command_user=${user}:${group}
command_args="-server -conf=${config} -datadir=${datadir} -pid=${pidfile}"
extra_started_commands="reload"

depend() {
	use net
	after logger firewall
}

reload() {
	ebegin "Reloading ${RC_SVCNAME}"
	start-stop-daemon --signal HUP --pidfile "${pidfile}"
	eend $?
}
